<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>电气设备安装流程管理系统 － 管理者</title>
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- Morris Chart Styles-->

<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
<!-- TABLE STYLES-->
<link href="assets/js/dataTables/dataTables.bootstrap.css"
	rel="stylesheet" />
<link href="assets/css/bootstrap-datetimepicker.css"
	rel="stylesheet" />
<link href="assets/css/admin.css" rel="stylesheet" />
<style type="text/css">
#l-map {
	height: 300px;
	width: 100%;
}
</style>
</head>
<body class="workflow_manager">
	<div id="wrapper">
		<nav class="navbar navbar-default top-navbar" role="navigation">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".sidebar-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="index.html"><strong>电气管理系统</strong></a>
			</div>

			<ul class="nav navbar-top-links navbar-right">
				<!-- /.dropdown -->
				<li class="dropdown"><a class="dropdown-toggle"
					data-toggle="dropdown" href="#" aria-expanded="false"> <i
						class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
				</a>
					<ul class="dropdown-menu dropdown-user">
						<li><a href="user_logout.html"><i
								class="fa fa-sign-out fa-fw"></i> Logout</a></li>
					</ul> <!-- /.dropdown-user --></li>
				<!-- /.dropdown -->
			</ul>
		</nav>
		<!--/. NAV TOP  -->
		<nav class="navbar-default navbar-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav" id="main-menu">

					<li><a href="user_operatorList.html"><i
							class="fa fa-dashboard"></i> 安装人员管理</a></li>
					<li><a href="equipment_list.html"><i class="fa fa-desktop"></i>
							设备管理</a></li>
					<li><a href="user_center.html"><i
							class="fa fa-bar-chart-o"></i> 个人中心</a></li>

					<li><a href="workflow_list.html" class="active-menu"><i
							class="fa fa-table"></i>安装信息管理</a></li>
					</li>

				</ul>

			</div>

		</nav>
		<!-- /. NAV SIDE  -->
		<div id="page-wrapper">
			<div class="header">
				<h3 class="page-header">
					<small>当前位置：安装信息管理</small>
				</h3>
			</div>
			<div id="page-inner">
				<div class="row" id="list" style="display: block;">
					<div class="col-md-12">
						<!-- Advanced Tables -->
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="table-responsive">
									<a id="addWorkflow" class="btn btn-primary btn-sm">添加记录</a>
									<table class="table table-striped table-bordered table-hover"
										id="dataTables-example">
										<thead>
											<tr>
												<th>序号</th>
												<th class="hidden">id</th>
												<th class="hidden">设备id</th>
												<th>设备名称</th>
												<th class="hidden">人员id</th>
												<th>安装人员</th>
												<th>安装时间</th>
												<th>安装状态</th>
												<th>安装地址</th>
												<th>联系电话</th>
												<th class="hidden">lng</th>
												<th class="hidden">lat</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach items="${list}" var="workflow" varStatus="sta">
												<tr class="item" data-id="${workflow.id}">
													<th class="editable">${sta.index+1}</th>
													<th class="editable hidden" name="workflow.id">${workflow.id}</th>
													<th class="editable hidden" name="workflow.equipment.id">${workflow.equipment.id}</th>
													<th class="editable" name="workflow.equipment.name">${workflow.equipment.name}</th>
													<th class="editable hidden" name="workflow.user.id">${workflow.user.id}</th>
													<th class="editable" name="workflow.user.name">${workflow.user.name}</th>
													<th class="editable" name="workflow.time"><fmt:formatDate value="${workflow.time}" type="date"></fmt:formatDate></th>
													<th class="editable" name="workflow.status">${workflow.status}</th>
													<th class="editable" name="workflow.primaryKey">${workflow.primaryKey}</th>
													<th class="editable" name="workflow.phone">${workflow.phone}</th>
													<th class="editable hidden" name="workflow.lng">${workflow.lng}</th>
													<th class="editable hidden" name="workflow.lat">${workflow.lat}</th>
													<td class="center"><a
														class="btn btn-link btn-sm delete">删除</a>|<a href="#"
														class="btn btn-link btn-sm editInstall">修改</a></td>
												</tr>
											</c:forEach>
										</tbody>
									</table>

								</div>
							</div>
						</div>
						<!--End Advanced Tables -->
					</div>
				</div>

				<div class="row" id="installForm" style="display: none;">
					<div class="col-lg-12">

						<div class="panel panel-default">
							<div class="panel-body">
								<div class="row">
									<div class="col-lg-6">
										<p>修改设备安裝信息：</p>
									</div>
								</div>
								<hr>
								<div class="row">
									<div class="col-lg-6">
										<form class="form-horizontal" action="workflow_add.html"
											method="post">
											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">安装设备</label>
												<div class="col-sm-8">
													<select class="form-control" name="equipmentid">
													<c:forEach items="${equipment}" var="equipment" varStatus="sta">
														<option value="${equipment.id }">${equipment.name }</option>
													</c:forEach>
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">安装设备人员</label>
												<div class="col-sm-8">
													<select class="form-control" name="userid">
													<c:forEach items="${user}" var="user" varStatus="sta">
														<option value="${user.id }">${user.name }</option>
													</c:forEach>
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">联系方式</label>
												<div class="col-sm-8">
													<input type="text" name="workflow.phone"
														class="form-control" placeholder="安装人员联系方式">
												</div>
											</div>

											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">安装地点</label>
												<div class="col-sm-8">
													<input type="text" id="suggestId"
														name="workflow.primaryKey" class="form-control"
														placeholder="安装地点">
													<div id="searchResultPanel"
														style="border: 1px solid #C0C0C0; height: auto; display: none;"></div>

													<input type="hidden" id="lng" name="workflow.lng">

													<input type="hidden" id="lat" name="workflow.lat">
												</div>
											</div>
											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">安装状态</label>
												<div class="col-sm-8">
													<select class="form-control" name="workflow.status">
														<option value="等待安装" >等待安装</option>
														<option value="已安装" selected>已安装</option>
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="inputEmail3" class="col-sm-4 control-label">安装时间</label>
												<div class="col-sm-8">
													<input type="text" class="form-control" name="time"
														id="form_datetime" placeholder="安装时间">
												</div>
											</div>
										</form>
									</div>

									<div class="col-lg-6">
										<div id="l-map"></div>
									</div>
								</div>
								<div class="row">&nbsp;</div>
								<div class="row">
									<div class="col-lg-1 col-lg-offset-2">
										<a class="btn btn-warning submit">确定</a>
									</div>
									<div class="col-lg-1">
										<a class="btn btn-default close" data-dismiss="modal">取消</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /. PAGE INNER  -->
		</div>
		<!-- 确认删除 -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-body">确定移除该记录吗？</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-warning confirm">确定
						</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
		</div>
	</div>
	<!-- /.modal -->
	<!-- /. PAGE WRAPPER  -->
	<!-- /. WRAPPER  -->
	<!-- JS Scripts-->
	<!-- jQuery Js -->
	<script src="assets/js/jquery-1.10.2.js"></script>
	<!-- Bootstrap Js -->
	<script src="assets/js/bootstrap.min.js"></script>
	<!-- Metis Menu Js -->
	<script src="assets/js/jquery.metisMenu.js"></script>
	<!-- DATA TABLE SCRIPTS -->
	<script src="assets/js/dataTables/jquery.dataTables.js"></script>
	<script src="assets/js/dataTables/dataTables.bootstrap.js"></script>
	<script>
		$(document).ready(function() {
			$('#dataTables-example').dataTable();
		});
	</script>
	<script type="text/javascript"
		src="http://api.map.baidu.com/api?v=2.0&ak=btLGkjnTx0nz7DaRruMs5jf6g74B31Ts"></script>
	<script>
		var map = new BMap.Map("l-map");
	</script>
		<script src="assets/js/timepicker/bootstrap-datetimepicker.js"></script>
	<script type="text/javascript">
    $("#form_datetime").datetimepicker({
        format: "Y-m-d",
        foramtDate:"Y-m-d",
        lang:'ch',
        timepicker:false
    });
</script>   
	<script src="assets/js/admin_user.js"></script>

</body>
</html>
